package cn.edu.scau.cmi.zenghaonan.chapter04;

public class PerfectNumber {

	public static void main(String[] args) {
		int i,j,s;
		for(i=2;i<=1000;i++) {
			s=0;
			for(j=1;j<i;j++) {
				if(i%j==0)
				s+=j;
			}
			if(i==s) {
				System.out.println(i);
			}
		}
	}
}
